{% extends "kbforums/base.html" %}
{% from "layout/errorlist.html" import errorlist %}
{% from "kbforums/includes/macros.html" import kbforums_warning with context %}
{# L10n: {t} is the title of the thread. {d} is the name of the document. #}
{% set title = _('Edit thread {t} | {d} Discussion | Knowledge Base')|f(t=thread.title, d=document.title) %}
{% set crumbs = [(document.get_absolute_url(), document.title),
                 (url('wiki.discuss.threads', document.slug), _('Discuss')),
                 (url('wiki.discuss.posts', document.slug, thread.id), thread.title),
                 (None, _('Edit thread'))] %}

{% block content %}
  <article id="edit-thread" class="grid_9">
    {{ kbforums_warning(document, user) }}
    <h1>{{ _('Edit thread "{t}"')|f(t=thread.title) }}</h1>

    <form action="{{ url('wiki.discuss.edit_thread', document.slug, thread.id) }}" method="post" class="edit-thread">
      {% csrf_token %}
      {{ errorlist(form) }}

      <div class="form-widget{% if form.title.errors %} invalid{% endif %}">
        {{ form.title.label_tag()|safe }}
        {{ form.title|safe }}
      </div>

      <div class="form-widget submit">
        <button type="submit" class="btn btn-submit big">{{ _('Update thread') }}</button>
        <a class="btn" href="{{ url('wiki.discuss.posts', document.slug, thread.id) }}">{{ _('Cancel') }}</a>
      </div>
    </form>
  </article>
{% endblock %}
